#ifndef __KRUSKALTREE__
#define __KRUSKALTREE__
#include <list>

class KruskalTree{
public:
	KruskalTree(int NodeNum, int ArcNum):node_num_(NodeNum),arc_num_(ArcNum){}
	~KruskalTree();
	void CreateGraph();
	int GetKruskalTree();
	void MakeSet(char a);
	char FindSet(char a);
	void Union(char, char b);
private:
	int node_num_;
	int arc_num_;
	typedef std::pair<char ,char> c_pair;
	typedef std::pair<c_pair, int> cw_pair;
	std::list<cw_pair> weights_;
	int *father;
	int *rank;
	struct node_cmp {
		inline bool operator()(cw_pair& a , cw_pair& b) const{
			return a.second < b.second;
		}
	};
};
#endif